package com.hyq.market.ui.login;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.hannesdorfmann.mosby.mvp.MvpPresenter;
import com.hyq.market.R;
import com.hyq.market.api.BaseRequest;
import com.hyq.market.base.AbsAct;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class LoginActivity extends AbsAct implements View.OnClickListener,IViewLogin {

    @BindView(R.id.edit_phone)
    EditText editPhone;
    @BindView(R.id.edit_passwd)
    EditText editPasswd;
    @BindView(R.id.button_send)
    Button buttonSend;
    PersenterLogin presenter;


    @NonNull
    @Override
    public MvpPresenter createPresenter() {
        presenter=new PersenterLogin(this);
        return presenter;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_login;
    }

    @Override
    protected void initEvent() {

    }



    @OnClick(R.id.button_send)
    @Override
    public void onClick(View view) {
        BaseRequest request=new BaseRequest();
        request.setUname(editPhone.getText().toString());
        request.setId(editPasswd.getText().toString());
        presenter.getData(request);
    }

    @Override
    public <T> void loadData(T t) {

    }

    @Override
    public void startActivity(Class c) {

    }

    @Override
    public void startActivity(Class c, Bundle bundle, int isResult) {

    }




}
